﻿@model YueQian.ShortUrl.ViewModels.WebUrlListViewModel
@using YueQian.ShortUrl.Extensions;

@{
    Layout = "~/Views/Shared/_UserLayout.cshtml";
}
<script src="~/Scripts/My97DatePicker/WdatePicker.js"></script>
<script src="/Scripts/ZeroClipboard/ZeroClipboard.min.js"></script>
<script src="~/Content/user/scripts/shorturl.list.js"></script>
<div class="tab-content default-tab" id="tab1">
    <form action="" method="get">
        <div>
            <input type="text" class="text-input" style="width:120px;" name="keyword" value="@Model.SearchModel.Keyword" placeholder="关键词" />
            <input type="text" class="text-input Wdate" style="width: 80px;" onclick="WdatePicker()" readonly="readonly" name="startDate" value="@Model.SearchModel.StartDate" placeholder="开始时间" />
            <input type="text" class="text-input Wdate" style="width: 80px;" onclick="WdatePicker()" readonly="readonly" name="endDate" value="@Model.SearchModel.EndDate" placeholder="结束时间" />
            <input class="button" type="submit" value="搜索" />
            <input class="button" type="reset" value="重置" onclick="javascript: window.location.href = '/User/List'" />
        </div>
    </form>
    <table class="datalist">
        <thead>
            <tr>
                <th>
                    <input class="check-all" type="checkbox" />
                </th>
                <th style="width: 110px;text-align:center;">
                    操作
                </th>
                <th>
                    跃迁短址
                </th>
                <th>
                    原址
                </th>
                <th style="width: 100px;">
                    更新时间
                </th>
                <th style="width: 50px;text-align:center;">
                    复制
                </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="6">
                    @Html.Pager()
                    <div class="clear">
                    </div>
                </td>
            </tr>
        </tfoot>
        <tbody>
            @if (Model.List != null)
            {
                var i = 0;
                foreach (var item in Model.List)
                {
                    <tr class="@(i % 2 == 1 ? "alt" : "n")">
                        <td>
                            <input name="sid" value="@item.Id" type="checkbox" />
                        </td>
                        <td>
                            <a href="/User/Update/@item.Id">修改</a>
                            <a class="del" href="/User/DeleteUrls/@item.Id?returnUrl=@Request.RawUrl" data-title="@item.Description">删除</a>
                        </td>
                        <td>
                            @Html.Raw(item.Title)
                        </td>
                        <td>
                            @item.Url
                        </td>
                        <td>@item.DateTimeString</td>
                        <td style="text-align:center;">
                            <input id="short@(item.Id)" type="hidden" value="@item.Keyword" />
                            <a data-clipboard-target="short@(item.Id)" class="copy">复制</a>
                        </td>
                    </tr>
                    i++;
                }
            }
        </tbody>
    </table>
</div>
